package com.jrx.anytxn.transaction.mapper.ext;

import com.jrx.anytxn.transaction.entity.TlDailyAccountLog;
import com.jrx.anytxn.transaction.mapper.base.TlDailyAccountLogMapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * @Author yhy
 * @Date 2023/5/4 9:47
 */
public interface ExtTlDailyAccountLogMapper extends TlDailyAccountLogMapper {

    /**
     * 批量插入 日终T24核心记账明细
     * @param tlDailyAccountLogList 日终T24核心汇总记账明细列表
     * @return
     */
    int batchInsert(List<TlDailyAccountLog> tlDailyAccountLogList);

    /**
     * 通过记账状态查询记账明细数据
     * @param returnStatus 记账状态
     * @return
     */
    List<TlDailyAccountLog> selectByStatus(@Param("returnStatus") String returnStatus);

    /**
     * 按照甲乙流水号更新记账明细流水表
     * @param tlDailyAccountLog
     * @return
     */
    int updateBySeqNo(TlDailyAccountLog tlDailyAccountLog);

    /**
     * 通过记账交易流水号查询记账明细数据
     * @param seqNo 记账状态
     * @return
     */
    List<TlDailyAccountLog> selectBySeqNo(@Param("seqNo") String seqNo);

    /**
     * 根据日期查询日终汇总的数据
     * @param tenantId
     * @param returnStatus
     * @param businessDate
     * @return
     */
    List<TlDailyAccountLog> selectDailyByBusinessDate(@Param("tenantId") String tenantId, @Param("returnStatus") String returnStatus, @Param("businessDate") Date businessDate);

    /**
     * 查询借据的日终汇总记录
     *
     * @param tenantId
     * @param customerId
     * @param loanId
     * @param productId
     * @param returnStatus
     * @return
     */
    List<TlDailyAccountLog> queryDailyAccountLog(@Param("tenantId") String tenantId, @Param("customerId") String customerId, @Param("loanId") String loanId, @Param("productId") String productId,
                                                 @Param("returnStatus") String returnStatus);
}

